import request from '@/utils/request'

export function getLevelDiscounts() {
    return request({
        url: '/admin/level-discount',
        method: 'get'
    })
}

export function addLevelDiscount(data) {
    return request({
        url: '/admin/level-discount',
        method: 'post',
        data
    })
}

export function updateLevelDiscount(data) {
    return request({
        url: '/admin/level-discount',
        method: 'put',
        data
    })
}

export function deleteLevelDiscount(id) {
    return request({
        url: `/admin/level-discount/${id}`,
        method: 'delete'
    })
}

export function getLevelDiscountByLevel(level) {
    return request({
        url: `/admin/level-discount/by-level/${level}`,
        method: 'get'
    })
}